package org.ligson.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class ConfigApplication {
    @ConfigurationProperties(prefix = "spring.redises")
    RedisConfig redisConfig() {
        return new RedisConfig();
    }

    @GetMapping("/test")
    public RedisConfig test(RedisConfig redisConfig) {
        return redisConfig;
    }

    public static void main(String[] args) {
        SpringApplication.run(ConfigApplication.class, args);
    }
}
